﻿// Please see documentation at https://learn.microsoft.com/aspnet/core/client-side/bundling-and-minification
// for details on configuring this project to bundle and minify static web assets.

window.API_BASE_URL = '/api'
var App = function () { };

App.prototype.initial = async function () {
    try {
        var res = await fetch(`${API_BASE_URL}/cfg`);
        var data = await res.json();

        var logoEl = document.querySelector('[data-logo]')
        if (logoEl) {
            logoEl.innerHTML = '<img src="' + data.logo + '" width="50" height="50"> ' + data.appName;
        }
    } catch (e) {
        throw e;
    }


}

// Write your JavaScript code.
window.addEventListener('DOMContentLoaded', async () => {
    var app = new App();
    await app.initial();
});